/*
 * Arm SCP/MCP Software
 * Copyright (c) 2025, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Description:
 *      SCMI Power Capping Requestor protocol support.
 */

#ifndef INTERNAL_SCMI_POWER_CAPPING_REQ_H
#define INTERNAL_SCMI_POWER_CAPPING_REQ_H

/*
 * POWERCAP_SET_CAP_FLAGS
 */

#define SCMI_POWER_CAPPPING_REQ_SET_FLAGS_ASYNC_POS          1U
#define SCMI_POWER_CAPPPING_REQ_SET_FLAGS_IGNORE_DELAYED_POS 0U

#define SCMI_POWER_CAPPPING_REQ_SET_FLAGS_ASYNC_MASK \
    FWK_BIT(SCMI_POWER_CAPPPING_REQ_SET_FLAGS_ASYNC_POS)
#define SCMI_PWR_CAP_SET_FLAGS_IGNORE_DELAYED_MASK \
    FWK_BIT(SCMI_POWER_CAPPPING_REQ_SET_FLAGS_IGNORE_DELAYED_POS)

#define SCMI_POWER_CAPPPING_REQ_SET_FLAGS(ASYNC, IGNORE_DELAYED) \
    ((((ASYNC) << SCMI_POWER_CAPPPING_REQ_SET_FLAGS_ASYNC_POS) & \
      SCMI_POWER_CAPPPING_REQ_SET_FLAGS_ASYNC_MASK) | \
     (((IGNORE_DELAYED) \
       << SCMI_POWER_CAPPPING_REQ_SET_FLAGS_IGNORE_DELAYED_POS) & \
      SCMI_PWR_CAP_SET_FLAGS_IGNORE_DELAYED_MASK))

/*
 * PROTOCOL_SET_CAP_ATTRIBUTES
 */

struct scmi_pcap_req_set_cap_a2p {
    uint32_t flags;
    uint32_t power_cap;
};

#endif /* INTERNAL_SCMI_POWER_CAPPING_REQ */
